package com.elpebe.sysabk.web;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.elpebe.sysabk.web.response.JsonResponseFactory;
import com.elpebe.sysabk.web.response.JsonResponseFactory.Response;

@Controller
@RequestMapping("/")
public class HomeController {
	
	@RequestMapping
	public String getHomePage() {
		return "home";
	}
	
	@RequestMapping("/navigationlist")
	public @ResponseBody Response getNavigationList(){
		
		List<Item> data = new ArrayList<Item>();
		data.add(new Item("Users"));
		data.add(new Item("Roles"));
		data.add(new Item("Settings"));
		
		return JsonResponseFactory.createSuccessResponse(data);
	}
	
	static class Item {
		
		private final String name;
		
		public Item(String name) {
			this.name = name;
		}

		public String getName() {			
			return this.name;
		}
	}
}
